<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .color{
            background-color: aquamarine;

        }
        .rcolor{
            background-color: gold;
        }
        .ac{
            background-color: dimgray;
        }
        .c{
            background-color: darkgray;
        }
    </style>
    <script>
        function qx() {
            var arr = document.getElementsByClassName("gou");
            for (var i = 0; i < arr.length; i++) {
                arr[i].checked = true;
            }
        }
        function qbx() {
            var arr = document.getElementsByClassName("gou");
            for (var i = 0; i < arr.length; i++) {
                arr[i].checked = false;
            }
        }
        function fx() {
            var arr = document.getElementsByClassName("gou");
            for (var i = 0; i < arr.length; i++) {
                if (arr[i].checked==false){
                    arr[i].checked = true;
                } else {
                    arr[i].checked = false;
                }
            }
        }
        function delh() {
            var arr = document.getElementsByClassName("gou");
            for (var i = 0; i < arr.length; i++) {
                if (arr[i].checked){
                    var a = arr[i].parentNode;
                    a = a.parentNode;
                    a.innerHTML = "";
                    i--;
                }
            }
        }
        function f() {
            var arr = document.getElementsByTagName('tr');
            for (var i = 1; i <arr.length; i++) {
                if (i%2==0){
                    arr[i].className = "rcolor";
                }
            }
        }
    </script>
</head>
<body onload="f()">
<table border="1" cellpadding="1" cellspacing="1">
    <th class="c">全选</th>
    <th class="c">发件人</th>
    <th class="c">邮件名称</th>
    <th class="c">邮件附属信息</th>
    <tr class="color" >
        <td><input type="checkbox" class="gou"></td>
        <td>张三11</td>
        <td>我是邮件11</td>
        <td>我是附属信息11</td>
    </tr>
    <tr class="color" >
        <td><input type="checkbox" class="gou"></td>
        <td>张三22</td>
        <td>我是邮件22</td>
        <td>我是附属信息22</td>
    </tr>
    <tr class="color" >
        <td><input type="checkbox" class="gou"></td>
        <td>张三33</td>
        <td>我是邮件33</td>
        <td>我是附属信息33</td>
    </tr>
    <tr class="color" >
        <td><input type="checkbox" class="gou"></td>
        <td>张三44</td>
        <td>我是邮件44</td>
        <td>我是附属信息44</td>
    </tr>
    <tr class="c">
        <td><button onclick="qx()">全选</button><br></td>
        <td colspan="3">
            <button onclick="qbx()">取相全选</button>
            <button onclick="fx()">反选</button>
            <button onclick="delh()">删除所选附件</button>
        </td>
    </tr>
</table>
</body>
</html>